#include "objetobj.hpp"

/* Constructeurs */
objetOBJ::objetOBJ() { _nom = "Default"; }

objetOBJ::objetOBJ(string n) { _nom = n; }

/* Get et Set des variables */
void objetOBJ::setNom(string n) { _nom = n; }

string objetOBJ::getNom(){ return _nom; }

int objetOBJ::getNbPoint(){ return nb_point; }

void objetOBJ::addPoint(Point3d &p)
{
    _points.push_back(p);
    nb_point = (int)_points.size();
}

void objetOBJ::genereFace()
{
    _points.push_back(_points.at(0));
    _points.push_back(_points.at(4));
    _points.push_back(_points.at(5));
    _points.push_back(_points.at(1));

    _points.push_back(_points.at(5));
    _points.push_back(_points.at(6));
    _points.push_back(_points.at(2));
    _points.push_back(_points.at(1));

    _points.push_back(_points.at(6));
    _points.push_back(_points.at(7));
    _points.push_back(_points.at(3));
    _points.push_back(_points.at(2));

    _points.push_back(_points.at(7));
    _points.push_back(_points.at(4));
    _points.push_back(_points.at(0));
    _points.push_back(_points.at(3));

    nb_point += 16;
}

Point3d objetOBJ::at(int i)
{
    return _points.at(i);
}



